#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n, b, i, cnt = 0, arr[101], flag = true;
	cin >> n >> b;
	if(n == 0){
		cout << "Yes\n0";
		return 0;
	}
	while(n != 0){
		arr[cnt++] = n % b;
		n /= b;
	}
	for(i = 0; i < cnt/2; i++){
		if(arr[i] != arr[cnt - 1 - i])
			flag = false;
	}
	if(flag)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
	cout << arr[cnt - 1];
	for(i = cnt - 2; i >= 0; i--)
		cout << " " << arr[i];
	return 0; 
} 
